import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Vue from 'vue'
import Layout from './components/Layout.vue'
const router=new VueRouter({
    routes:[
        {
            path:'/',
            redirect:'/login'
        },
        {
            path:'/login',
            component: () => import("./views/login.vue"),
        },
        {
            path:'/diary',
            component:Layout,
            redirect:'/diary/home',
            children:[
                {
                    path:'home',
                    component: () => import("./views/home/index.vue"),
                },
                {
                    path:'detail',
                    component: () => import("./views/detail.vue"),
                }
            ]
        },
    ]
})
export default router